1. Field of the Invention
The invention relates to computers and computer software. More particularly, the invention relates to a method, article of manufacture and apparatus for performing automatic intermodule call linkage optimization.
2. Description of the Related Art
Computer systems run or execute software programs to implement a variety of functions. These software programs or computer programs are conventionally written in a high-level language, e.g., C++. In particular, C++ is an object-oriented programming language in which programs are created using abstractions and constructs to create user-defined classes for defining the methods and variables for a particular type of object. All objects of a particular class are identical in form and behavior but contain different data on their variables.
The text of a computer program written in such a high-level language is called a source code. However, to more efficiently run a computer program, the computer program is conventionally converted from source code to machine language. A compiler is a computer program that converts or, more particularly, compiles source code into machine language. A compiled version of the source code is called an object code.
As computer systems execute a variety of software programs, there is a need to reduce the amount of time required to execute these programs. Many compilers currently incorporate some type of optimization to minimize the time for program execution, i.e., run-time optimization. In one type of compiler optimization, known as “inlining optimization,” the compiler replaces a call or invocation of a procedure with the instructions of the called procedure. By replacing the invocation of procedures, the inlining optimization eliminates the overhead required to call the procedure. However, if the source code or program contains many procedure calls, then inlining optimization considerably increases the amount of object code in the program.
An automatic implementation of run-time optimization is possible, but is limited to procedure calls in the same module in the source code or program. However, such an intramodule optimization fails to completely optimize a program having multiple modules.
An intermodule run-time optimization is implemented by storing certain parameters or variables in processor registers to eliminate the need to perform memory access during procedure calls or invocations. In this type of optimization, known as “argument optimization,” a programmer must manually modify a program or source code to indicate which procedures within the code are to be optimized. However, manual modification of the source code is subject to human errors and is difficult to implement. Therefore, there is a need in the art to provide an automatic and intermodule compiler optimization.